package com.ek.kademlia.protocol.impl;

import java.net.SocketAddress;
import java.util.LinkedList;
import java.util.List;

import com.ek.common.Bucket;
import com.ek.kademlia.protocol.FindNodeResponse;

public class DefaultFindNodeResponse implements FindNodeResponse {

    private static final long serialVersionUID = 20826560851526896L;

    private byte[] messageID;
    private byte[] nodeID;
    private List<Bucket> buckets = new LinkedList<Bucket>();
    private SocketAddress socketAddress;

    public byte[] getMessageID() {
        return messageID;
    }

    public void setMessageID(byte[] id) {
        this.messageID = id;
    }

    public String getMessageClass() {
        return FindNodeResponse.class.getCanonicalName();
    }

    public void setNodeID(byte[] nodeID) {
        this.nodeID = nodeID;
    }

    public byte[] getNodeID() {
        return nodeID;
    }

    public SocketAddress getSocketAddress() {
        return socketAddress;
    }

    public void setSocketAddress(SocketAddress serviceAddress) {
        this.socketAddress = serviceAddress;

    }

    public void setBuckets(List<Bucket> buckets) {
        this.buckets = buckets;
    }

    public List<Bucket> getBuckets() {
        return buckets;
    }

    public boolean addBucket(Bucket bucket) {
        return buckets.add(bucket);
    }

}
